package org.despair2D.net 
{
	
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.IOErrorEvent;
	import flash.events.SecurityErrorEvent;
	import flash.net.Socket;
	import flash.utils.Endian;
	
	/**
	 * 
	 * @author 
	 */
public class SocketDemo extends Sprite
{

	public function SocketDemo() 
	{
		socket = new Socket()
		socket.endian = Endian.BIG_ENDIAN
		socket.addEventListener(IOErrorEvent.IO_ERROR, io)
		socket.addEventListener(SecurityErrorEvent.SECURITY_ERROR, sec)
		socket.addEventListener(Event.CONNECT,conn)
		socket.connect(MAIN_IP, MAIN_PORT)
		
	}
	
	private function io(e:IOErrorEvent):void
	{
		trace('io')
	}
	private function sec(e:SecurityErrorEvent):void
	{
		trace('sec')
	}
	
	private function conn(e:Event):void
	{
		trace('conn')
	}
	
	
	static public var MAIN_IP:String = "ssn.app100679243.twsapp.com";			//主服务器ip					
	static public var MAIN_PORT:int = 8007;
	
	//private function f():void
	
	private var socket:Socket
}

}